<?php

$api = app('Dingo\Api\Routing\Router');

$api->version('V1',[
    'namespace'  =>'App\Http\Controllers\Api\V1\Frontend\News'
],function ($api){
    $api->group([
        'prefix'     => 'frontend',
        'middleware' => [
            'jwt.token'
        ]
    ],function ($api){
        $api->group([
            'prefix' => 'news'
        ],function ($api){
            //消息展示展示
            $api->get('index','IndexController@index')
                ->name('frontend.news.index.get');

            //查询消息首页自定义类别
            $api->get('zdType','IndexController@zdType')
                ->name('frontend.news.zdType.get');

            //查询消息列表数据
            $api->post('zdList','IndexController@zdList')
                ->name('frontend.news.zdList.post');

            //消息详情接口

             $api->post('zdInfo','IndexController@zdInfo')
                 ->name('frontend.news.zdInfo.post');

            //服务单列表

            $api->post('service_list','IndexController@ServiceList')
                ->name('frontend.news.service_list.post');
            //消息顶级分类
            $api->post('zdTypes','IndexController@zdTypes')
                ->name('frontend.news.zdTypes.post');

        });
    });

    //无需使用token验证
    $api->group([
        'prefix'     => 'article',
    ],function ($api){
        $api->post('articleInfo','IndexController@articleInfo')->name('article.articleInfo.post');
    });


    //供第三方调用
    $api->group([
        'prefix'     => 'frontend',
    ],function ($api){
        $api->group([
            'prefix' => 'news'
        ],function ($api){
            //消息类型
            $api->get('msgType','IndexController@msgType')
                ->name('frontend.news.msgType.get');

            //消息内容存储
            $api->post('msgCreate','IndexController@msgCreate')
                ->name('frontend.news.msgCreate.get');
        });
    });

});



